package com.ruoyi.common.utils.baidu;


import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSONReader;
import com.ruoyi.common.utils.RandomUtil;
import com.ruoyi.common.utils.StringUtils;
import okhttp3.*;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.PostMethod;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.*;

public class TransWebApi {

    private static final OkHttpClient client = new OkHttpClient();

    private static String cookie = "";

    public static void main(String[] args) throws Exception {
        JSONObject data = trans("like");
        System.err.println(data.getJSONObject("trans_result"));
        System.out.println("===================================");
        System.err.println(data);
    }

    public static JSONObject trans(String query) throws Exception {
//        String token = "32122d17c6d248dbb084d171abcf2549";
//        String cookie = "BIDUPSID=2CC8E95C6A0BFB5F7033BF5F08A3D146; PSTM=1605689128; BAIDUID=2CC8E95C6A0BFB5F0B49DCB22EEB05B7:FG=1; BDUSS=ZEYnFVeHVCSWQ0RXZhTDkzV3ZIWTJTOWJ5dUNlM2VoejNwYUNaMmFWa0I1T0pmRVFBQUFBJCQAAAAAAAAAAAEAAABKumgrd2VpZG9uZ18yMjgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFXu18BV7tfTX; BDUSS_BFESS=ZEYnFVeHVCSWQ0RXZhTDkzV3ZIWTJTOWJ5dUNlM2VoejNwYUNaMmFWa0I1T0pmRVFBQUFBJCQAAAAAAAAAAAEAAABKumgrd2VpZG9uZ18yMjgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFXu18BV7tfTX; REALTIME_TRANS_SWITCH=1; FANYI_WORD_SWITCH=1; HISTORY_SWITCH=1; SOUND_SPD_SWITCH=1; SOUND_PREFER_SWITCH=1; CHINA_PINYIN_SWITCH=0; DOUBLE_LANG_SWITCH=0; H_WISE_SIDS=154770_161228_160248_156287_161253_159609_159693_161300_160326_159383_161421_131862_161395_157262_161419_161969_127969_161893_161771_160101_161961_160898_161730_160505_131423_162413_161083_159704_158055_158832_160801_161965_155255_159954_160209_162154_144966_162094_162187_161240_139883_158640_155530_147551_162479_158791_162334_162642_162264_110085_162025; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; Hm_lvt_64ecd82404c51e03dc91cb9e8c025574=1606202701,1607346663; BAIDUID_BFESS=5C1711B4B86DF32C8E6495E85C1009B6:FG=1; ab_sr=1.0.0_NmQwOWQ5NjQzNzUyYWQyOGJmZDMxNjMyMjNhNTkyOThiMWQ1MjcyMzFhZDZmNTA2OTczOGI0ZWRiNmQxMjQ5ZjFlOWU4ZTk3ZGVhMjQ1MWE5YTc4NWUzZDk5NWM0YjI2; __yjsv5_shitong=1.0_7_2995f5f44bdc9adb400036c5c566a5f8d81d_300_1607525512201_221.221.151.191_b2279ac2; yjs_js_security_passport=d8bd4633760889c92a7a726d2b1710e34b0e4caa_1607525513_js";
//        String token = "84450854aacb45044172cf03a34e2e84";
//        String cookie = "BIDUPSID=D10A180BABA1B44954D398D7954043B8; PSTM=1645874846; BAIDUID=D10A180BABA1B4497F9B298A01C447AB:FG=1; BDSFRCVID_BFESS=YK-OJexroG0RCiJDKrwl-VYYeeKK0gOTDYLEOwXPsp3LGJLVgK9uEG0Pt_U-mEt-J8jwogKK0mOTH6KF_2uxOjjg8UtVJeC6EG0Ptf8g0M5; H_BDCLCKID_SF_BFESS=tbkD_C-MfIvDqTrP-trf5DCShUFs-t3AB2Q-XPoO3KJCEnT_QMRK5TOD3RrkK4QiWbRM2MbgylRp8P3y0bb2DUA1y4vpKMP8bmTxoUJ2XMKVDq5mqfCWMR-ebPRiJPr9Qg-qahQ7tt5W8ncFbT7l5hKpbt-q0x-jLTnhVn0MBCK0hI0ljj82e5PVKgTa54cbb4o2WbCQ3b828pcN2b5oQT8wLUrZ0UnHbKFL-fTw5R5vOIJTXpOUWfAkXpJvQnJjt2JxaqRC5hkBfq5jDh3MBpQDhtoJexIO2jvy0hvctn6cShPCyUjrDRLbXU6BK5vPbNcZ0l8K3l02V-bIe-t2XjQhDNtDt60jfn3aQ5rtKRTffjrnhPF3Mt_dXP6-hnjy3bRN5bTF3pvKfUAz3lrZbtLUyN3MWh3RymJ42-39LPO2hpRjyxv4bUn-5toxJpOJXaILWl52HlFWj43vbURvD-ug3-AqBM5dtjTO2bc_5KnlfMQ_bf--QfbQ0hOhqP-jBRIEoK0hJC-2bKvPKITD-tFO5eT22-usyCtL2hcHMPoosIJ-LPrkQMPX5p-LLqck5CTiaKJjBMbUoqRHXnJi0btQDPvxBf7p5208Ll5TtUJM_UKzhfoMqfTbMlJyKMnitIj9-pPKWhQrh459XP68bTkA5bjZKxtq3mkjbPbDfn028DKuDTtajj3QeaRabK6aKC5bL6rJabC3oqkzXU6q2bDeQN3N3-cZ3g3HLb4EQfTZeJ5oyT3JXp0vWtv4WbbvLT7johRTWqR4epkw5fonDh83Bn_L2xQJHmLOBt3O5hvvhb6O3MA-yUKmDloOW-TB5bbPLUQF5l8-sq0x0bOte-bQXH_E5bj2qRItoCI-3f; ZFY=2xFzUuaiHXu4rLegUfGl9iCiYfZY4xXHuWuIeC52iiQ:C; BAIDUID_BFESS=262517F230F7D5B220FA010A60FBC13C:FG=1; APPGUIDE_10_0_2=1; SOUND_SPD_SWITCH=1; REALTIME_TRANS_SWITCH=1; HISTORY_SWITCH=1; FANYI_WORD_SWITCH=1; SOUND_PREFER_SWITCH=1; Hm_lvt_246a5e7d3670cfba258184e42d902b31=1657679011; Hm_lpvt_246a5e7d3670cfba258184e42d902b31=1657679011; Hm_lvt_64ecd82404c51e03dc91cb9e8c025574=1657610305,1657679031; ab_sr=1.0.1_YjFjMzRiYjk3YjdjYTk2MDMyMTZhZTU3NzViZDI0MDk4MWQ5NzZlODNjZGJiYWYzZTNlMmRhMDkyYjEyMjZjYmYxMjI4OGFkYzljOTM3M2U0YmY2YzFiMTc0ZDVjM2I1N2IwOGEwY2YzMWQxZWJkMjBkMDgwN2Q1MjQzOTQ2NmZkOWJjNzY0ZjlhMzdlMzNkODIxMjFhNTdkZjMzNjAzNw==; Hm_lpvt_64ecd82404c51e03dc91cb9e8c025574=1657707570";
//        String token = "a0208c432b93a18474a873e2cdbe1ea0";
//        String cookie = "BAIDUID=C799C035467F96B3539A5F29595BCFA8:FG=1; BAIDUID_BFESS=C799C035467F96B3539A5F29595BCFA8:FG=1; Hm_lvt_64ecd82404c51e03dc91cb9e8c025574=1657708820; Hm_lpvt_64ecd82404c51e03dc91cb9e8c025574=1657708820; APPGUIDE_10_0_2=1; REALTIME_TRANS_SWITCH=1; FANYI_WORD_SWITCH=1; HISTORY_SWITCH=1; SOUND_SPD_SWITCH=1; SOUND_PREFER_SWITCH=1; ab_sr=1.0.1_MGVlMTYwOWEwYjA5OGVmNTU1YTVkYjljZjQ4YjkxOTRiOGI1YTdhM2NjNzRhNzU0YmI0MWUzNWRmYTk3ZTlkMTdmMGI3ZjVjYWQyOTJlOWU1NzFmZDM5MzNlZTliNWJlNjY1NDRiYmQ5YzM5ZjQ2MTY2ZjM4MWMyOWRkMWI1ZjNhN2UyN2FjMjA3ZGRiMmZiZDJmOGFiOGZjMjE2M2M5ZA==";
        String token = "2b45882503a24a25727a8835119cf6f3";
        String cookie = "BIDUPSID=9B2F766B428B989BF0C32E89F4FA7E40; PSTM=1640180361; MAWEBCUID=web_KioEsNNoxsHTBlQoYFhRgFalGRDoPeQSBqgspHJFmyHQbepuKo; BAIDUID=A4FE8BABF710C8060CECD4340B977120:FG=1; APPGUIDE_10_6_9=1; REALTIME_TRANS_SWITCH=1; FANYI_WORD_SWITCH=1; HISTORY_SWITCH=1; SOUND_SPD_SWITCH=1; SOUND_PREFER_SWITCH=1; BDUSS=25yanhCWHdNRVFOMkNpS2IwVzJlT0d0cnc0Y0ZCZVFwb2xOUHVreVI4aW9uaGhtSVFBQUFBJCQAAAAAAAAAAAEAAABKumgrd2VpZG9uZ18yMjgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKgR8WWoEfFlM; BDUSS_BFESS=25yanhCWHdNRVFOMkNpS2IwVzJlT0d0cnc0Y0ZCZVFwb2xOUHVreVI4aW9uaGhtSVFBQUFBJCQAAAAAAAAAAAEAAABKumgrd2VpZG9uZ18yMjgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKgR8WWoEfFlM; APPGUIDE_10_7_1=1; Hm_lvt_64ecd82404c51e03dc91cb9e8c025574=1709809473,1710487265; H_WISE_SIDS_BFESS=40170_39661_40211_40217_40319_40079_40365_40352_40381_40369_40409_40415_40309_40445_40299_40466; BA_HECTOR=2l2k2l2h84008h012h0hag8hkoga7l1ivklf91t; BAIDUID_BFESS=A4FE8BABF710C8060CECD4340B977120:FG=1; ZFY=8dghV8204jMCtGWld0GfOYIR8rHiU8op8nsVYaJQ74M:C; BDRCVFR[feWj1Vr5u3D]=I67x6TjHwwYf0; delPer=0; PSINO=6; MCITY=-218%3A; H_PS_PSSID=40170_39661_40211_40217_40319_40079_40365_40352_40381_40369_40409_40415_40309_40445_40299_40466_40317; RT=\"z=1&dm=baidu.com&si=c121f87c-d0f7-43c7-8556-d420c778fcb5&ss=ltznkkju&sl=1&tt=ig&bcn=https%3A%2F%2Ffclog.baidu.com%2Flog%2Fweirwood%3Ftype%3Dperf&ld=3br&nu=468vwj63&cl=6q6&ul=arf&hd=b6t\"; H_WISE_SIDS=40170_39661_40211_40217_40319_40079_40365_40352_40381_40369_40409_40415_40309_40445_40299_40466_40317; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; ab_sr=1.0.1_ZmU2MmZiYjM5YzU4MTg4ODU3YmQxMDMyZGE0MDE1MmQ2NzI5YzIxY2IwN2FkZDFkYjU4NDNhMDhhOWMxOTA4OTU0NWI2OWU4NTJmZjljOWY4MDQ4ZmEzNTNiZTVhNTZmZTVjNmNkNjhmNTQ4N2FlNDkzYTIxZjQyMWU3MjIxZTBhODU5MTEwOTc4NWFlY2UwMGE4NjhmZWY1OWZmNzRlNTAzYjI3YmI1NDc4ZjcwODhiNTFiMzc0NWIyZDY1Zjcz; Hm_lpvt_64ecd82404c51e03dc91cb9e8c025574=1710940545";
        String html = HttpGet.get("https://fanyi.baidu.com/?aldtype=16047#en/zh/" + query, new HashMap());
        Document document = Jsoup.parse(html);
        String jsonData = document.getElementsByTag("script").get(1).html().replace("page.common = ", "");
        jsonData = jsonData.substring(0, jsonData.length() - 1);
        String gtk = JSON.parseObject(jsonData, JSONReader.Feature.AllowUnQuotedFieldNames).getString("gtk");
        final String sign = ExecuJs.getBaiduFanYiExecResult(query, gtk);
        // System.out.println(sign);
        String finalToken = token;
        Map<String, String> params = new LinkedHashMap<>();
        params.put("from", "en");
        params.put("to", "zh");
        params.put("query", query);
        params.put("token", finalToken);
        params.put("sign", sign);
        params.put("domain", "common");
        params.put("simple_means_flag", "3");

        Thread.sleep(RandomUtil.getRandomNum(4));
        TransWebApi.cookie = cookie;
        String targetUrl = "https://fanyi.baidu.com/v2transapi?from=en&to=zh";
//        String res = postFormData(targetUrl, params);// post("https://fanyi.baidu.com/v2transapi?from=en&to=zh", params);

//        res = StringUtils.unicodeToCn(res);
        // JSONObject data = postFormDataNew(targetUrl, params);
        String res = fetchByCurl(params);
        JSONObject data = JSON.parseObject(res);
        // JSONObject dict_result = data.getJSONObject("dict_result");
        // System.out.println(JSON.toJSONString(dict_result));
        return data;
    }

    public static JSONObject postFormDataNew(String url, Map<String, String> params) throws Exception {
        OkHttpClient client = new OkHttpClient().newBuilder()
                .build();
        MultipartBody.Builder body = new MultipartBody.Builder().setType(MultipartBody.FORM);
        params.keySet().forEach(k -> body.addFormDataPart(k,params.get(k)));
        Request request = new Request.Builder()
                .url(url)
                .method("POST", body.build())
                .addHeader("Cookie", "BAIDUID=A4FE8BABF710C8060CECD4340B977120:FG=1;")
                .addHeader("Host", "fanyi.baidu.com")
                .build();
        Response response = client.newCall(request).execute();
        if (response.isSuccessful()) {
            // 请求成功，读取响应体内容
            String responseBody = response.body().string();
            System.out.println("Response body: " + responseBody);

            // 将JSON字符串转换为Java对象
            return JSON.parseObject(responseBody);
        } else {
            // 请求失败，打印错误信息
            System.out.println("Request failed with code: " + response.code());
        }
        return null;
    }

    public static String fetchByCurl(Map<String, String> params) {
        try {
            // 构建curl命令列表
            List<String> curlCommand = new ArrayList<>();
            curlCommand.add("curl");
            curlCommand.add("-X"); // 设置请求类型
            curlCommand.add("POST");
            curlCommand.add("-H"); // 设置请求头，这里用于添加Cookie
            curlCommand.add("Cookie: BAIDUID=A4FE8BABF710C8060CECD4340B977120:FG=1;");
            curlCommand.add("-H");
            curlCommand.add("Host: fanyi.baidu.com");
            curlCommand.add("-H");
            curlCommand.add("Acs-Token: 1710936008666_1711004711151_MfSq4li/FtKYn/TiMlc+55+ma3+m0fPIOBXLbBIOOWHOZmbIfjaR5goYO+5/5ywysrTZTgye6WDpJZZKEItRnPbVqNZ6DkmFP8ZIEm8QWEHmeR+mTZui6XuYb+KTRZ4DDQpJJogFZbkdHj9jIBE/BqHeESdJsunf07zhKeDNJFsDSsT9obBFOD2+vvyrfB6iRUYX/O0j9EO1oQq5jDEH/9dM++gVUeegGy2DQoETFJdYOgye+yh4k94sUaMaSQ/7lfg/HlITANG6lkhqQEfn46X2IcM+Z/ASPXS2jFRka865KNLX7hTf5qLT6d7X18TEBKily8wZIQOMS6oPXVBPXbhAGCHjRIlMcnDKgkQtUE7cjYme4iaXXkTJ9VVUuExn57OPfAb5lmsaKtOHoXsnSu/xcTr194z5PL3kkIdEfznA+8EWQvwNbQ+7Td7SSUQQvlE1eo2ZEkyoHp7eBFI70VjLx2zfxVt5Es45QARRZcU=");
            String data = "";//"from=en&to=zh&query=adjective&sign=950569.680472&token=2b45882503a24a25727a8835119cf6f3&domain=common";
            for(String k: params.keySet()) {
                data += (k + "=" + params.get(k) + "&");
            }
            data = data.substring(0, data.length() - 1);
            if (!data.isEmpty()) {
                curlCommand.add("-d"); // 如果是POST请求，添加请求体数据
                curlCommand.add(data);
            }
            curlCommand.add("https://fanyi.baidu.com/v2transapi?from=en&to=zh");
            // 创建ProcessBuilder实例，执行curl命令
            ProcessBuilder builder = new ProcessBuilder(curlCommand);
//            builder.redirectErrorStream(true);
            Process process = builder.start();
            // 获取标准输出流的BufferedReader
            BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
            // 逐行读取输出
            String line;
            StringBuilder sb = new StringBuilder();
            while ((line = reader.readLine()) != null) {
                if(StringUtils.isNotEmpty(line)) {
                    sb.append(line);
                }
            }
            // 等待进程结束
            int exitCode = process.waitFor();
            return sb.toString();
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
        return null;
    }

    public static JSONObject postFormData(String url, MultiValueMap<String, Object> params) throws NoSuchAlgorithmException, KeyManagementException {
        HttpHeaders headers = new HttpHeaders();
        headers.add("Cookie", "BAIDUID=A4FE8BABF710C8060CECD4340B977120:FG=1;; BAIDUID=8AF15E164CF61DC9A93E22C8CC6369EF:FG=1; BAIDUID_BFESS=3007FC0C26E0BF7F5FD12B36695D85D9:FG=1");
//        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
        headers.add("Content-Type", "multipart/form-data; boundary=--------------------------361640840335589869371729");

        //MultiValueMap<String, String> map = new LinkedMultiValueMap<String, String>();
        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity<MultiValueMap<String, Object>>(params, headers);
        //String urlParams = url + "?params={json}";
        RestTemplate restTemplate = RestTemplateWithTrustAllCerts.createRestTemplateWithTrustAllCerts();

        ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, httpEntity, String.class);

        //ResponseEntity<String> responseEntity = restTemplate.exchange(urlHeader+modelUrl, HttpMethod.POST, httpEntity, String.class);
        return JSON.parseObject(responseEntity.getBody());

    }

    public static String post(String url, Map<String, String> params) {
        try {
            PostMethod postMethod = new PostMethod(url);
            postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
            postMethod.setRequestHeader("Cookie", cookie);
            postMethod.setRequestHeader("Host", "fanyi.baidu.com");
            postMethod.setRequestHeader("Referer", "https://fanyi.baidu.com/");
            postMethod.setRequestHeader("user-agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36");
            Object[] keys = params.keySet().toArray();
            NameValuePair[] data = new NameValuePair[keys.length];

            for(int i = 0; i < keys.length; ++i) {
                data[i] = new NameValuePair(keys[i].toString(), params.get(keys[i]));
            }
            postMethod.setRequestBody(data);
            HttpClient httpClient = new HttpClient();
            httpClient.executeMethod(postMethod);
            // System.out.print("return statusCode: " + postMethod.getStatusCode());
            InputStream inputStream = postMethod.getResponseBodyAsStream();
            BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
            StringBuilder sb = new StringBuilder();
            String str = "";
            while ((str = br.readLine()) != null) {
                sb.append(str);
            }
            return sb.toString();
//            FormBody.Builder formBodyBuilder = new FormBody.Builder();
//            Object[] keys = params.keySet().toArray();
//            for(int i = 0; i < keys.length; ++i) {
//                formBodyBuilder.add(keys[i].toString(), params.get(keys[i]));
//            }
//            RequestBody formBody = formBodyBuilder.build();
//            Request request = new Request.Builder().url(url).post(formBody)
//                    .addHeader("cookie", "BIDUPSID=2CC8E95C6A0BFB5F7033BF5F08A3D146; PSTM=1605689128; BAIDUID=2CC8E95C6A0BFB5F0B49DCB22EEB05B7:FG=1; BDUSS=ZEYnFVeHVCSWQ0RXZhTDkzV3ZIWTJTOWJ5dUNlM2VoejNwYUNaMmFWa0I1T0pmRVFBQUFBJCQAAAAAAAAAAAEAAABKumgrd2VpZG9uZ18yMjgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFXu18BV7tfTX; BDUSS_BFESS=ZEYnFVeHVCSWQ0RXZhTDkzV3ZIWTJTOWJ5dUNlM2VoejNwYUNaMmFWa0I1T0pmRVFBQUFBJCQAAAAAAAAAAAEAAABKumgrd2VpZG9uZ18yMjgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFXu18BV7tfTX; REALTIME_TRANS_SWITCH=1; FANYI_WORD_SWITCH=1; HISTORY_SWITCH=1; SOUND_SPD_SWITCH=1; SOUND_PREFER_SWITCH=1; CHINA_PINYIN_SWITCH=0; DOUBLE_LANG_SWITCH=0; Hm_lvt_64ecd82404c51e03dc91cb9e8c025574=1606202701; H_WISE_SIDS=154770_161228_160248_156287_161253_159609_159693_161300_160326_159383_161421_131862_161395_157262_161419_161969_127969_161893_161771_160101_161961_160898_161730_160505_131423_162413_161083_159704_158055_158832_160801_161965_155255_159954_160209_162154_144966_162094_162187_161240_139883_158640_155530_147551_162479_158791_162334_162642_162264_110085_162025; BAIDUID_BFESS=865EB64EC2420EB910CB3B76F6A59024:FG=1; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; BDRCVFR[feWj1Vr5u3D]=I67x6TjHwwYf0; delPer=0; PSINO=2; BCLID=11107475754836895681; BDSFRCVID=XFIOJexroG3STncrvYqBhFNfnuweG7bTDYLE2IcaprdK7U8VJeC6EG0Pts1-dEu-EHtdogKK0gOTH6KF_2uxOjjg8UtVJeC6EG0Ptf8g0M5; H_BDCLCKID_SF=tR3h3RrX26rDHJTg5DTjhPrMW-jAWMT-MTryKKORQnrjq4QXKf5sQxCEhlofKx-fKHnRhlRNtqTjHtJ4bM4b3jkZyxomtfQxtNRJQKDE5p5hKq5S5-OobUPUDMJ9LUkqW2cdot5yBbc8eIna5hjkbfJBQttjQn3hfIkj2CKLK-oj-D8mejK-3e; H_PS_PSSID=33213_1469_33212_33061_31253_33113_33099_33101_33183_33181_33231_33198_33217_33149_33216_33215_33185; BA_HECTOR=8g0h25242g0k0h84561fsgk5e0q; __yjsv5_shitong=1.0_7_2995f5f44bdc9adb400036c5c566a5f8d81d_300_1606963379746_111.203.4.66_b7f88d27; yjs_js_security_passport=46e22d27eeb8d07842a606990b6fefecc4001a54_1606963381_js")
//                    .addHeader("Content-Type", "application/x-www-form-urlencoded")
//                    .addHeader("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36")
//                    .build();
//            Response response = client.newCall(request).execute();
//            if (!response.isSuccessful())
//                throw new IOException("Unexpected code " + response);
//            return response.body().string();
        } catch (Exception var7) {
            var7.printStackTrace();
            return null;
        }
    }
}